Skip to content

Conversation

@peaklabs-dev
Copy link

Changes

  • When using Svelte with package managers other than npm the installation is a bit cumbersome, as we have to translate each command ourselves. This PR adds commands for yarn, pnpm and bun.
  • When using Svelte with something like https://inertiajs.com/ the installation is a bit difficult, since we must gather commands from various sources. To make this much easier the Getting Started guide now provides instructions for installing Svelte directly into an existing project with commands for all packages managers.
  • The svelte-check package for tooling is also valuable (CI checks), so I added the commands to install it as well.

@changeset-bot
Copy link

changeset-bot bot commented Dec 16, 2025

⚠️ No Changeset found

Latest commit: 8caa4b5

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@svelte-docs-bot
Copy link

@peaklabs-dev peaklabs-dev marked this pull request as ready for review December 16, 2025 00:08
@Rich-Harris
Copy link
Member

Thank you. My inclination is not to merge this:

  • I'd be open to a switcher UI for different package managers (similar to the JS/TS language one, which remembers your preference), but listing them all like this looks very cluttered. In the meantime I think it's reasonable to expect that if someone is using a non-default package manager, they know how to use it

  • Explaining how to install svelte-check separately doesn't really make sense unless you also explain how to invoke it. Since running sv check will tell you how to install it, it's better to just steer people in that direction rather than giving them options, which can only add confusion. (There are a couple of improvements we could make here — we could replace sv check with npx sv check, link directly to the docs, and have the CLI detect your package manager when prompting you to install svelte-check. Will follow up)

  • The added section isn't really 'installing Svelte in an existing project', but 'installing Svelte in an existing Vite project'. I would propose this change instead (will follow up):

    -You can also use Svelte directly with Vite by running `npm create vite@latest` and selecting the `svelte` option. With this, `npm run build` will generate HTML, JS, and CSS files inside the `dist` directory using [vite-plugin-svelte](https://github.com/sveltejs/vite-plugin-svelte). In most cases, you will probably need to [choose a routing library](/packages#routing) as well.
    +You can also use Svelte directly with Vite via [vite-plugin-svelte](https://github.com/sveltejs/vite-plugin-svelte) by running `npm create vite@latest` and selecting the `svelte` option (or, if working with an existing project, adding the plugin to your `vite.config.js` file). With this, `npm run build` will generate HTML, JS, and CSS files inside the `dist` directory. In most cases, you will probably need to [choose a routing library](/packages#routing) as well.

    As for Inertia, my read of https://inertiajs.com/docs/v2/installation/client-side-setup is that it's already taken care of somehow? Or, at the very least, that adding the Vite plugin would be insufficient without also using @inertiajs/svelte. If those docs are incomplete then it would be something to fix on the Inertia side.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants